'use strict';
angular.module('app.api').controller('ApiTestCtrl', function ($scope,orders,projectHttpS) {
	
	
	/*var json = {
			  "action": "项目",
			  "des": "封邮件"
	           };
	
    $scope.test = json;*/
    
    var json1 = {
    		"name":"eee",
    	    "des":"eeeee",
    		"oper":"add"
    			}	
    $scope.test1 = json1;

   
   /* projectHttpS.postAll1('page_project').then(function (response) {
    	console.log(response);
    	$scope.allaction = response.content;
    });
    */
   $scope.postdata = {};
    $scope.operate = function() {
    	projectHttpS.postAll1('page_project', $scope.postdata).then(function (response) {
           
            $scope.test = response;
         })
        }
   /* $scope.add = function() {
    	projectHttpS.postAll1('page_project', $scope.postdata).then(function (response) {
            console.log(response);
            $scope.test2 = response;
         })
        }*/
    
})

//注册用户

'use strict';
angular.module('app.api').controller('RegistrationCtrl', function ($scope, apijson, returnjson,userHttpS,personalCenterHttp) {

    $scope.apijson = apijson.data;
    $scope.returnjson = returnjson.data;
   
    $scope.postdata = {};
    $scope.operate = function () {
        
        personalCenterHttp.postAll('register_user', $scope.postdata).then(function (response) {
            
            $scope.test = response;
        })
    }
	
})

// 创建公司
 'use strict';   
  angular.module('app.api').controller('CreateCompanyCtrl', function ($scope, apijsons, returnjsons, userHttpS) {

        $scope.apijson = apijsons.data;
        $scope.returnjson = returnjsons.data;
        $scope.postdata = {};
        $scope.operate = function () {
            
            userHttpS.postAll('register_comp ', $scope.postdata).then(function (response) {
                
                 $scope.test = response;
             })
         }
    

  })

  'use strict';
  angular.module('app.api').controller('AttendCompCtrl', function ($scope, apijsons, returnjsons, userHttpS, jurisHttpS) {

      $scope.apijson = apijsons.data;
      $scope.returnjson = returnjsons.data;

       
      userHttpS.getList('company_user').then(function (response) {
          $scope.data = response;

      })
      jurisHttpS.getAll('getallrole').then(function (response) {

          $scope.allRole = response;

      })

      userHttpS.getList('user').then(function (response) {
          $scope.dataUser = response;
          $scope.allUser = response;

      })

      $scope.dataRole = myAppGlobal.userManager.get_role();
      

      $scope.user = {};
       
      $scope.operate = function () {

          userHttpS.postAll('attend_comp', $scope.user).then(function (response) {
              
              $scope.attend_comp = response;
          })
      }

  })

//
  'use strict';
  angular.module('app.api').controller('AccessCompanyCtrl', function ($scope, apijsons, returnjsons, userHttpS,personalCenterHttp) {

      personalCenterHttp.getAll('user_comp').then(function (response) {
             
         
          $scope.allcompany = response;

      })

      $scope.company = {};
      $scope.operate = function () {
          
          personalCenterHttp.postAll('join_session', $scope.company).then(function (response) {
              
              $scope.returnvalue = response;
             
          })
      }

      $scope.apijson = apijsons.data;
      $scope.returnjson = returnjsons.data;



  })



 